package org.rednebula.framework.core.model.eo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import org.rednebula.framework.core.IEnvironment;
import org.rednebula.framework.core.model.SelfName;
import org.rednebula.framework.core.service.IDbService;
import org.rednebula.framework.core.service.ServiceFacade;
import org.rednebula.framework.core.service.StringIdentService;
import org.rednebula.framework.core.utils.InternalConstant;




@MappedSuperclass
public  abstract class BasicEO extends SelfName implements IEO, Serializable {
    
	
	private String ident;
	
	
	public void setIdent(String ident) {
		this.ident = ident;
	}

	
    @Id
	@Column(name = "IDENT")
	public  String getIdent() {
		return ident;
	}

    public String getSelfSuffix(){
    	return InternalConstant.EO_SUFFIX;
    }
	public IDbService getHibernateService(IEnvironment env){
		return env.lookup(InternalConstant.HIBERNATEDBSERVICE);
	}
	
	public String buildIdent(IEnvironment env){
		return getSelfName()+getStringIdentService(env).build(env, this.getSelfName());
	}
	
	public String getPrefix(){
		return this.getSelfName();
	}
	public StringIdentService getStringIdentService(IEnvironment env){
		return ServiceFacade.getStringIdentService(env);
	}
	
	public void load(IEnvironment env) {
		// TODO Auto-generated method stub

	}


	public void create(IEnvironment env) {
		// TODO Auto-generated method stub
		
	}

	public void delete(IEnvironment env) {
		// TODO Auto-generated method stub
		
	}

	public void modify(IEnvironment env) {
		// TODO Auto-generated method stub
		
	}

}
